Skip to content

fix(skills): let skills with the same effect share one magic effect - #1614

Merged
sven-n merged 1 commit into
MUnique:masterfrom
icheat2win:fix/shared-skill-effects
Nov 24, 2026
Merged

sven-n merged 1 commit into
MUnique:masterfrom
icheat2win:fix/shared-skill-effects

Conversation

@icheat2win

Copy link
Copy Markdown
Contributor

Fixes #1526 (the part for new databases)

What

The skills with the same poison or ice effect setting share one magic effect, instead of each one getting its own identical Poisoned or Iced effect.

Why

CreateEffect looks for an existing effect and compares the chance with Equals(e.Chance?.ConstantValue.Value, chance). An effect without a chance has no Chance value, so null was compared with 0 and never matched. A Season 6 database got 14 Iced and 7 Poisoned effects.

Changes

  • SkillsInitializerBase.CreateEffect and the same method of AddMovementSpeedAttributesPlugInBase count a missing chance as 0.
  • Effects which really differ stay apart, e.g. the Cold effect of Chain Drive with its 40% chance.

Existing databases keep their copies. Merging them needs an update plug-in which must leave customized copies alone, so it's left for a follow-up.

Tests

  • New SkillEffectsDataTest.SkillsShareIdenticalEffectsAsync: no two Poisoned, Iced, Cold or Freeze effects of a new Season 6 database have the same number, element, duration, chance and target. It fails without the fix (13 and 6 duplicates).
  • All of tests/MUnique.OpenMU.Persistence.Initialization.Tests pass (870 passed, 12 skipped).

CreateEffect compared the chance of an existing effect with Equals, but an
effect without a chance has no Chance value at all, so the comparison
never matched and every poison and ice skill got its own identical
Poisoned or Iced effect. A missing chance now counts as 0, so new
databases get one effect per distinct setting.

Fixes MUnique#1526

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011xNc75fJTee8EPxDxQxuGi
@chatgpt-codex-connector

Copy link
Copy Markdown
Codex Review Summary: ❌ Failed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ❌ Failed 2026-11-24T02:51:21.933663Z
We couldn’t complete this review. Comment @codex review to try again.
4c69a3b PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, you can upgrade your account or add credits to your account and enable them for code reviews in your settings.

@codacy-production

Copy link
Copy Markdown

Up to standards ✅

🟢 Issues 0 issues

Results:
0 new issues

View in Codacy

🟢 Metrics 6 complexity · 4 duplication

Metric Results
Complexity 6
Duplication 4

View in Codacy

NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.

@sven-n sven-n left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Comparing the chance as (e.Chance?.ConstantValue.Value ?? 0) == chance fixes the null-vs-0 mismatch, so skills with the same poison or ice setting share one effect in new databases (instead of 14 Iced and 7 Poisoned copies). Existing databases keep their identical duplicates, which is harmless.

I built it on current master and ran the tests, including Persistence.Initialization.Tests (1011 passed): everything passes.


Generated by Claude Code

@sven-n
sven-n merged commit 7ed245e into MUnique:master Nov 24, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Season 6 data creates a separate, identical Poisoned/Iced effect for each skill

3 participants